﻿

    function textboxautocomple(id) {
        this.id = id;
        switch (id) {
            case paginas.nivelusuario:

                $(function () {

                    $("#tags").autocomplete({

                        source: function (request, response) {
                            sonicERPinterface.WSdal.getnivelusuario(request.term, function (data) {

                                var json = eval(data);

                                response($.map(json, function (item) { return { label: item} }));

                            });

                        }

                    });

                });
                break;
            case paginas.cliente:

                $(function () {

                    $("#tags").autocomplete({

                        source: function (request, response) {
                            sonicERPinterface.WSdal.getcliente(request.term, function (data) {

                                var json = eval(data);

                                response($.map(json, function (item) { return { label: item} }));

                            });

                        }

                    });

                });
                break;
            case paginas.fornecedor:

                $(function () {

                    $("#tags").autocomplete({

                        source: function (request, response) {
                            sonicERPinterface.WSdal.getfornecedor(request.term, function (data) {

                                var json = eval(data);

                                response($.map(json, function (item) { return { label: item} }));

                            });

                        }

                    });

                });
                break;
            case paginas.usuario:

                $(function () {

                    $("#tags").autocomplete({

                        source: function (request, response) {
                            sonicERPinterface.WSdal.getusuario(request.term, function (data) {

                                var json = eval(data);

                                response($.map(json, function (item) { return { label: item} }));

                            });

                        }

                    });

                });
                break;
        }
    }

    